package com.fudan.cfg.action;

import java.util.Map;

import com.fudan.cfg.base.ActionDef;
import com.fudan.run.ctx.annotation.ActionAdapter;

@ActionAdapter("saveToEs")
public class SaveToEs extends ActionDef{
	private static final String INDEX = "index";
	private String index;
	private String target;
	private Integer partition = 5;
	public SaveToEs(String name, String type,String target) {
		super(name, type,target);
	}

	@Override
	public ActionDef build(Map<String, Object> configuration) {
		this.index = (String) configuration.get(INDEX);
		this.target = (String) configuration.get("target");
		Object pd = configuration.get("partition");
		if(pd != null) {
			this.partition = (Integer) pd;
		}
		return this;
	}

	public String getIndex() {
		return index;
	}

	public void setIndex(String index) {
		this.index = index;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public Integer getPartition() {
		return partition;
	}

	public void setPartition(Integer partition) {
		this.partition = partition;
	}

}
